package org.duang;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import org.duang.kit.HttpKit;
import org.duang.kit.HttpKit.ContentTypeEnum;

public class SmsApp {

	public static void main(String[] args) {
//		Map<String,String>params = new HashMap<String,String>();
//		params.put("product","");
//		params.put("expressOrderNo","5-20160622-1-5298802700");
//		params.put("tel","4000103131");
//		List<String> list = new ArrayList<String>();
//		list.add("13431913636");
//		list.add("13750022242");
//		list.add("13192294108");
//		SmsMessage msg = SmsKit.duang().code("38").param(params).phone(list) .send();
//		System.out.println(msg.isSuccess()+"           ###           "+msg.getContent());
		
		
//		String subject = "这是一封迟来的告白！";
//		String text = "一段情要埋藏多少年，一封信要迟来多少天，两颗心要承受多少痛苦的煎熬，才能够彼此完全明了，你应该会明白我的爱，虽然我从未想你坦白.....";
//		String html = "<html><body>一段<font size='80' color='red'>情</font>要埋藏多少年，一封信要迟来多少<u><b>天</b></u>，两颗<img src='http://file.sythealth.com/html/qingmall/img/camp.png'></img>心要承受多少痛苦的煎熬，才能够彼此完全明了，你应该会明白我的爱，虽然我从未想你坦白.....</body></html>";
//		try {
//			Set<String> set = new HashSet<String>();
////			set.add("tech@sythealth.com");
////			set.add("tcrct@163.com");
//			set.add("tcrct@sina.com");
////			set.add("10147460@qq.com");
//			for(int i=0; i<5; i++){
//				String subject1 = i+"_"+subject;
//				EmailKit.duang().from("tangchunran@sythealth.com").pwd("syt12345678").to("tcrct@163.com").subject(subject1).text(text).asynSend();
//				EmailKit.duang().from("tangchunran@sythealth.com").pwd("syt12345678").to("tcrct@sina.com").subject(subject1).text(text).asynSend();
//			}
//			System.out.println("##########");
////			EmailKit.duang().from("tangchunran@sythealth.com").pwd("syt12345678").to(set).subject(subject).html(html).send();
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		List<Test2> list = new ArrayList<Test2>();
//		Test2 test2 = new Test2();
//		Test test = new Test();
		/*
		test2.setId("a");
		Test2 test3 = new Test2();
		test3.setId("b");
		
		list.add(test2);
		list.add(test3);
		
		
		test.setList(list);
		
		Update update = new Update();
		update.set("testList", test.getList());
		System.out.println(update.getUpdateObj().toString());
		
		
		
		Map<String,Test2> map = new HashMap<String,Test2>();
		map.put("1", test2);
		map.put("2", test3);
		test = new Test();
		test.setMap(map);
		
		update = new Update();
		update.set("testMap", test.getMap());
		System.out.println(update.getUpdateObj().toString());
		*/
//		List<String> sList = new ArrayList<String>();
//		sList.add("!");
//		sList.add("@");
//		sList.add("#");
//		test.setsList(sList);
//		
//		
//		
//		
//		Test3  test3 = new Test3();
//		 test2 = new Test2();
//		 test2.setId("!@#");
//		test3.setTest2(test2);
//		test3.setNum(123d);
//		
//		Update update = new Update();
////		update.set("id", "");
////		{"_id":"PS07","kcal":853,"step":0}
//		Map<String,Object>  map = new HashMap<String,Object>();
//		map.put("_id", "PS08");
//		map.put("kcal", 853);
//		map.put("step", 0);
//		update.set("otherTotalCal", 2259);
//		update.pull("otherSport", map);
////		update.pull(key, value)
////		update.inc("bbb", "123");
//		
//		
//		System.out.println(update.getUpdateObj().toString());
//		
		
		
//	    	String header = "Fitness/4.3.1.2(iPhone;iOS 8.1.2;Scale/3.00)";
//	    		//Fitness/4.3.1(iPhone;iOS 8.1.2;Scale/3.00)
//	    		String since = header.substring(header.indexOf("/")+1,header.indexOf("("));
//	    		System.out.println(since+"                 "+since.length());
//	    		if(since.length() > 5) {
//	    			since = since.substring(0, 5);
//	    		}
//	    		System.out.println(since);
		
		
//		TypeVariable[] tv = (TypeVariable[])list.getClass().getTypeParameters();
////		System.out.println(list.getClass().getGenericSuperclass());
////		System.out.println(tv[1].getClass().getAnnotation(Vo.class));
//		Type[] paramTypes = ((ParameterizedType) list.getClass().getGenericSuperclass()).getActualTypeArguments();
//		System.out.println(paramTypes[0]);
		
//		
//		String url = "http://192.168.0.39/";
//		url = url.endsWith("/") ? url.substring(0, url.length()-1) : url;
//		System.out.println(url);
		
		try {
//			Process process = Runtime.getRuntime().exec("nbtstat -a 192.168.0.106" );
			/*
			Process process = Runtime.getRuntime().exec("ipconfig -all" );
		
		InputStreamReader ir = new InputStreamReader(process.getInputStream(), "GBK");
		LineNumberReader input = new LineNumberReader(ir);
		String line=""; String smac="";
		while ((line = input.readLine()) != null) {
			if (line.toLowerCase().indexOf("physical") > 0 || line.indexOf("物理地址") > 0) {
				smac = line.substring(line.indexOf("-") - 2);
				break;
			}
		}
		System.out.println(smac);
		*/
			Map<String,Object> paramMap = new HashMap<String,Object>();
			paramMap.put("name", "laotang");
			HttpKit.duang().url("http://192.168.0.38:8080/rpc/main2").type(ContentTypeEnum.TEXT_HTML).param(paramMap).post();
		
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
